Class Term

java.lang.Object
edu.uky.ai.lp.logic.Term
All Implemented Interfaces:
Formula
Direct Known Subclasses:
Constant, Variable

public abstract class Term
extends java.lang.Object
implements Formula
The superclass of all logical expression representing specific things in the universe.
Author:
Stephen G. Ware
  • Field Summary

    Fields 
    Modifier and Type Field Description
    java.lang.String name
    The unique name of the term
  • Constructor Summary

    Constructors 
    Constructor Description
    Term​(java.lang.String name)
    Constructs a new term with a given name.
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object other)  
    int hashCode()  
    abstract Term substitute​(Unifier unifier)
    Return a version of this formula with its variables replaced with the values assigned to them by a unifier.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface edu.uky.ai.lp.logic.Formula

    unify
  • Field Details

    • name

      public final java.lang.String name
      The unique name of the term
  • Constructor Details

    • Term

      public Term​(java.lang.String name)
      Constructs a new term with a given name.
      Parameters:
      name - the name of the term
  • Method Details

    • equals

      public boolean equals​(java.lang.Object other)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • substitute

      public abstract Term substitute​(Unifier unifier)
      Description copied from interface: Formula
      Return a version of this formula with its variables replaced with the values assigned to them by a unifier.
      Specified by:
      substitute in interface Formula
      Parameters:
      unifier - the unifier
      Returns:
      the formula with variables replaced